<?php /* Smarty version Smarty-3.1.14, created on 2017-08-17 11:49:11
         compiled from "E:\phpStudy\WWW\zyshop\admin\templates\goods_sx.html" */ ?>
<?php /*%%SmartyHeaderCode:525659951237bec8d5-32150320%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '277fe8b533b082aa7752da6c5d168a72d459bf11' => 
    array (
      0 => 'E:\\phpStudy\\WWW\\zyshop\\admin\\templates\\goods_sx.html',
      1 => 1502528528,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '525659951237bec8d5-32150320',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'region_list' => 0,
    'region' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.14',
  'unifunc' => 'content_59951237c17706_88092333',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_59951237c17706_88092333')) {function content_59951237c17706_88092333($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<body>
<div class="fixed-bar">
  <div class="item-title">
    <h3>商品属性</h3>
    <div style="background:rgba(251,112,45,1);width:125px;height:40px;float:right;text-align:center;border-radius:5px;">
      <a class="tj_sx">
        <h5 style="padding:10px;color:#fff;">添加属性</h5>
      </a>
    </div>
  </div>
</div>
<div class="fixed_bottom">
    <form action="goods_sx.php" method="post">
        <div class="sx_wai">
            <div class="sx_con">
                <?php  $_smarty_tpl->tpl_vars['region'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['region']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['region_list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['region']->key => $_smarty_tpl->tpl_vars['region']->value){
$_smarty_tpl->tpl_vars['region']->_loop = true;
?>
                <div class="sx_content">
                    <div class="sx_con_l"><input  type="text" name="name" onchange="jiaodain(this)" value="<?php echo $_smarty_tpl->tpl_vars['region']->value['name'];?>
"  alt="<?php echo $_smarty_tpl->tpl_vars['region']->value['id'];?>
" ></div>
                    <div class="sx_con_c"><input type="text" name="content" onchange="jiaodain(this)" value="<?php echo $_smarty_tpl->tpl_vars['region']->value['content'];?>
" alt="<?php echo $_smarty_tpl->tpl_vars['region']->value['id'];?>
"></div>
                    <div class="sx_con_r"><a href="goods_sx.php?act=del&id=<?php echo $_smarty_tpl->tpl_vars['region']->value['id'];?>
">删除</a></div>
                    <!--<div class="sx_xg"><input type="submit" value="修改"></div>-->
                    <div style="clear: both;"></div>
                </div>
                <?php } ?>
            </div>
            <input type="hidden" name="act" value="goods_add" />
        </div>
        <div class="sx_tijiao"><input type="submit" value="提交">
        </div>
    </form>
</div>
</body>
<script>
    var con=`<div class="sx_content"><input type="hidden" name="id" value="" />
            <div class="sx_con_l"><input type="text" name="name" value=""></div>
    <div class="sx_con_c"><input type="text" name="content" value=""></div>
    <div class="sx_con_r"><a>自定义</a></div>
    <div style="clear: both;"></div>
    </div>`;
    $(".tj_sx").click(function(){
        $(".sx_con").append(con);
    }); 
    //元素改变的时候
    function jiaodain(th){
        var val=$(th).val();
        var id=$(th).attr("alt");
		var name=$(th).attr("name");
       $.post("goods_sx.php?act=edit",{id:id,val:val,name:name},function(data){
            if(data==1){layer.msg("操作成功！");}else{layer.msg("操作失败！");}
        })
    }
</script>
</html><?php }} ?>